package com.wcy.feign.user;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wcy.entity.UserLearningHistory;
import com.wcy.entity.pageVo.ApiDescriptor;
import com.wcy.entity.pageVo.ColumnConstructor;
import com.wcy.entity.pageVo.PageData;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Objects;

@FeignClient(name = "cloud-provider-user", contextId = "FeignUserLearningHistoryService")
public interface FeignUserLearningHistoryService {
    @GetMapping("userLearningHistory/page")
    public ResponseEntity<Page<UserLearningHistory>> getPage(@RequestParam(name = "pageNum",defaultValue = "1") int pageNum,
                                                             @RequestParam(name = "pageSize",defaultValue = "10") int pageSize);
    @GetMapping("userLearningHistory/list")
    public ResponseEntity<List<UserLearningHistory>> getList();
    @PostMapping("userLearningHistory/add")
    public ResponseEntity<Void> add(@RequestBody UserLearningHistory userLearningHistory);
    @PutMapping("userLearningHistory/update")
    public ResponseEntity<Void> update(@RequestBody UserLearningHistory userLearningHistory);
    @DeleteMapping("userLearningHistory/delete/{id}")
    public ResponseEntity<Void> delete(@PathVariable("id") Integer id);

    @PostMapping("userLearningHistory/sendHistory")
    public ResponseEntity<Void> sendHistory(@RequestBody UserLearningHistory userLearningHistory);

    @GetMapping("userLearningHistory/getHistoryData")
    public ResponseEntity<List<UserLearningHistory>> getHistoryData();
    @GetMapping("userLearningHistory/user/page")
    public ResponseEntity<Page<UserLearningHistory>> getUserHistoryPage(@RequestParam(name = "pageNum",defaultValue = "1") int pageNum,
                                                                            @RequestParam(name = "pageSize",defaultValue = "10") int pageSize);
    @DeleteMapping("userLearningHistory/user/delete/{id}")
    public ResponseEntity<Void> deleteHistory(@PathVariable("id") Integer id);

    @GetMapping("userLearningHistory/user/sum")
    public ResponseEntity<Long> getSumLearningTime();
}
